
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
 * @Problem 11799 - HorrorDash
 * @author Cesar Augusto Meneses Guzman
 * @version 1.0
 * @since 21 de Abril de 2013
 */
public class HorrorDash {
    
    public static void main( String args[] ) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        short T = Short.parseShort(br.readLine() );
        short N;
        int c = 0;
        int W = 0;
        
        for( int i = 0; i < T; i++ ) {
            String data[] = br.readLine().split("[ ]+");
            N = Short.parseShort( data[ 0 ] );
            for ( int j = 1; j <= N; j++ ) {
                c = Integer.parseInt(data[j]) > c ? Integer.parseInt(data[j]) : c;
            }
            System.out.println("Case " + (i + 1) + ": " + c);
        }
    }
}
